rem
	bbdoc: Contains last messages and shows out last of them
end rem
Type TConsole
	Field content:TList'Last messages
	Field lastAdded:Int
	
	
	Function Create:TConsole()
		Local d:TConsole=New TConsole
		d.content=New TList		
		Return d
	End Function
	
	
	Method Draw()
		Local ln=content.Count()
		Local i:Int
		SetImageFont consoleFont
		For i = ln To ln + 1 - (LowerBar / CONSOLEFONT_SIZE) Step - 1
			If i>0 Then DrawText(String(content.ValueAtIndex(i-1)),0,GH-CONSOLEFONT_SIZE*(ln-i)-10)
		Next
'		DrawText(String(content.ValueAtIndex(ln-1)),0,GH)
'		DrawText(String(content.ValueAtIndex(ln-2)),0,)
		SetImageFont mainFont
	End Method
	
	
	Method consoleAdd(Message:String)
		If MilliSecs()-lastAdded<50 Then
			Local tmp:String
			tmp=String(content.ValueAtIndex(content.Count()-1))
			content.RemoveLast
			content.AddLast(tmp+"."+Message)
		Else 
			content.AddLast(Message)
		EndIf
		lastAdded=MilliSecs()
		If content.Count()>50 Then content.RemoveFirst
	End Method
End Type
